package tests;


import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import business.Departamento;
import business.Seccao;

public class SeccaoTest {

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}
	
	@Test
	public void validConstruct(){
		Seccao s = new Seccao("sec1", new Departamento());
	}
	
	@Test (expected=AssertionError.class)
	public void invalidConstruct(){
		Seccao s = new Seccao(null, null);
	}
	
	@Test
	public void validSetName(){
		Seccao s = new Seccao();
		s.setNome("sec1");
	}
	
	@Test (expected=AssertionError.class)
	public void invalidSetName(){
		Seccao s = new Seccao();
		s.setNome(null);
	}

	@Test
	public void validSetDepartamento(){
		Seccao s = new Seccao();
		s.setDepartamento(new Departamento());
	}
	
	@Test (expected=AssertionError.class)
	public void invalidSetDepartamento(){
		Seccao s = new Seccao();
		s.setDepartamento(null);
	}
	
	@Test
	public void objectosTester(){
		Seccao.objectos();
	}
	
	@Test
	public void resetTester(){
		Seccao.reset();
	}
	
	@Test
	public void getterTester(){
		Seccao s = new Seccao();
		s.getClass();
		s.getDepartamento();
		s.getNome();
	}
	
	@Test
	public void toStringTester(){
		Seccao s = new Seccao();
		s.setDepartamento(new Departamento());
		s.setNome("John Doe");
		s.toString();
	}
}
